<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* 盒子模型大小用 padding * 2 + border * 2 + width 或者 height */
     /* 仅适用于自己写 calc不算 */
    div {
      width: 240px;
      height: 240px;
      background-color: pink;
      border: 10px solid #000;
      padding: 20px;

    }
  </style>
</head>
<body>
  <div>div</div>
</body>
</html>